﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Sio.Mdm.BF.Idm;
using Sio.Mdm.Types.Database;
using Ext.Net;
using Sio.Mdm.Entities;
using Sio.Mdm.Client;
using Sio.Mdm.BF.Sifranti;
using Sio.Mdm.Types;
using System.Collections.Generic;

namespace Sio.Mdm.Web.Uporabnik
{
	public partial class NepedagoskiKader : Controls.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack && !X.IsAjaxRequest)
			{
                NaloziPodatke(Request.GetValue<int>("vlogaid"));
			}

		}
		public void NaloziPodatke(int vlogaId)
		{
			if (vlogaId < 0)
			{
				vlogaId = 100;
			}
			//pošte
			EntityCollection<PostnaStevilka> poste = new EntityCollection<PostnaStevilka>(
				new Filter<PostnaStevilka>().Where(o => o.PostaId != null).OrderBy(o => o.PostnaStevilka));
			this.StorePoste.DataSource = poste;
			this.StorePoste.DataBind();

			//poklic
			EntityCollection<Poklic> poklic = new EntityCollection<Poklic>(
				new Filter<Poklic>().Where(o => o.PoklicId != null).OrderBy(o => o.Naziv));
			this.StorePoklic.DataSource = poklic;
			this.StorePoklic.DataBind();

			//delovno mesto
			EntityCollection<DelovnoMesto> DelovnoMesto = new EntityCollection<DelovnoMesto>(
				new Filter<DelovnoMesto>().Where(o => o.DelovnoMestoId != null).OrderBy(o => o.Naziv));
			this.StoreDelovnoMesto.DataSource = DelovnoMesto;
			this.StoreDelovnoMesto.DataBind();

		}
	}
}
